<template>
  <div>
    <el-row type="flex" justify="center">
      <el-col :xs="18" :sm="12" :md="10" :lg="8" :xl="8">
        <form class="search-content clearfix" :class="{focus: isFoucs}">
          <input type="text" class="search"
                 @focus="searchFocus"
                 @blur="searchFocus"/>
<!--          <div class="el-icon-search icon-clear"></div>-->
          <div class="el-icon-search icon-search"></div>
        </form>

      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "Search",
  data(){
    return {
        isFoucs: false
    }
  },
  methods: {
    searchFocus(){
      this.isFoucs = !this.isFoucs
      this.$emit('showMask',this.isFoucs)
    }
  }
}
</script>

<style>
@import "~assets/css/ele.css";
</style>
<style scoped>
*{
  box-sizing: border-box;
}
.search-content{
  position: relative;
  line-height: 34px;
  border: 2px solid transparent;
  background-color: rgba(255,255,255,.3);
  border-radius: 17px;
}
.search-content .search{
  float: left;
  width: 90%;
  height: 34px;
  padding: 0 13px;
  border-bottom-left-radius: 17px;
  border-top-left-radius: 17px;
  background-color: transparent;
  border: none;
}
.search-content .search:focus{
  outline: none;
}
.search-content.focus{
  background-color: #fff;
  border: 2px solid var(--color--primary);
  border-radius: 17px;
}

.search-content .icon-search{
  float: right;
  width: 10%;
  height: 100%;
  border-bottom-right-radius: 17px;
  border-top-right-radius: 17px;
  line-height: 20px;
  text-align: center;
  border-left: 1px solid #E0E0E0;
  margin: 7px 0;
  color: #F39801;
  font-weight: 600;
}
.search-content .icon-clear{

}

</style>
